ci: CI pipeline and changesets-driven release to npm - #13
Merged
Conversation
CI runs lint, format, build, unit, e2e and devtools tests on every PR and push to main. Release is driven by changesets: a changeset in a PR produces a "version packages" PR, merging it publishes webactor to npm over OIDC trusted publishing (no NPM_TOKEN, provenance included). webactor-devtools is marked private so it is never published, and the manual release scripts in packages/webactor are replaced by a prepack step that carries the root README into the published tarball. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
The repo was renamed from actorr to webactor; the changesets changelog config and the npm package metadata need the real name, and the trusted publisher must be registered against it or OIDC auth fails. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
The worker fixture imports the built dist, so `vitest run` on a machine that had never built the package saw a dead worker and three failures; the test script now builds first, matching what the devtools suite already does. channel-storm aborted its mid-flight opens on a 5ms timer, assuming the open request reaches the supporter faster than that. On CI a channel open averages 43ms, so every abort landed before the request was ever sent and nothing was lost before a handshake. The supporter now fires the abort itself when the request arrives, which orders the two events on any machine. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
The README claimed MIT-style usage but no license text existed, so npm would have listed the package as unlicensed. prepack now carries LICENSE into the tarball alongside the README, since npm only picks up a license file that sits in the package directory. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds the missing GitHub flow: CI on every PR, and an automated release of
webactorto npm.CI —
.github/workflows/ci.ymlFour parallel jobs on every PR and push to
main:checkpnpm lint,pnpm format:check,pnpm build(includestsc --noEmitper package)unitpnpm test:unit— 130 vitest testse2epnpm test:e2e— 32 Playwright load testsdevtoolspnpm test:devtools— 32 Playwright panel/extension teststest-results/is uploaded as an artifact when a Playwright job fails. Setup (pnpm → Node from.node-version→pnpm install --frozen-lockfile) is factored into a composite action so it isn't repeated four times.Release —
.github/workflows/release.ymlDriven by changesets:
.changeset/*.mddescribing the bump.mainthe workflow opens/updates achore(release): version packagesPR containing the version bump and generatedCHANGELOG.md.pnpm release→ build →changeset publish→ npm + git tag + GitHub Release.Auth is npm trusted publishing over OIDC — no
NPM_TOKENin the repo, and releases get a provenance attestation automatically.Two defects the first CI run exposed
Both were real, both reproduce locally once you know how — neither was papered over.
Unit tests silently depended on a previous build.
tests/worker/worker.mjsis a Node worker fixture, so it imports../../dist/index.jsrather than the TS source. On a machine that had never built the package the worker never came up and three tests failed on empty message arrays.rm -rf packages/webactor/dist && pnpm test:unitreproduces it. The package'stestscript now builds first, matching whatwebactor-devtoolsalready did.channel-stormraced with machine speed. It aborted its mid-flight opens on asetTimeout(..., 5), assuming the open request reaches the supporter within 5ms; on a 2-core runner a channel open averages 43ms, so every abort landed before the request was sent andsupportsLostBeforeHandshakecame back 0 instead of 100. Rather than relax the assertion, each mid-flight open now carries a unique marker and the supporter fires that abort the moment the request arrives — strictly before its ownsupportChannelcall, on any machine.Also in here
LICENSEpluslicensefields — the README claimed MIT-style usage but no license text existed, so npm would have listed the package as unlicensed.webactor-devtoolsmarkedprivate— it is never published; changesets skips it (privatePackages: { version: false }).release/release:betascripts removed frompackages/webactor, so publishing can only happen through CI.prepack/postpackcarry the root README and LICENSE into the package at pack time — withfiles: ["dist"]the tarball would otherwise ship without either.AStaroverov/actorrtoAStaroverov/webactor; the repo was renamed and npm's OIDC check validates the real name..node-version(26.5.0), CI + npm badges, andCONTRIBUTING.mddocumenting the flow.Before merging
webactor→ Settings → Trusted publisher → GitHub Actions, orgAStaroverov, repowebactor, workflowrelease.yml, environment empty. Without it the publish step fails with a 404.webactor@1.0.0immediately. npm currently has0.3.3aslatest, and there are no pending changesets, so the first run onmaintakes the publish path rather than opening a version PR.Note for later:
changeset publishshells out topnpm publish, notnpm publish. pnpm 10.x handles OIDC fine, but pnpm 11.0.8 has a regression (pnpm/pnpm#11513) — worth checking before bumpingpackageManager.Verification
Every command CI runs was run locally on this branch: lint, format:check, build, unit (130 passed, verified from a cold
dist/), e2e (32 passed), devtools (32 passed).changeset versionwas executed for real against a throwaway changeset — it produced a correct bump plusCHANGELOG.md— and reverted.pnpm packconfirmed README and LICENSE land in the tarball and the copies are cleaned up afterwards.🤖 Generated with Claude Code